/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controllers;
import EntityBean.*;

import java.util.Date;
import java.util.List;
import javax.sql.*;
import javax.servlet.http.*;



/**
 *
 * @author
 */
public class FindTripController extends HttpServlet{
//    public ArrayList validFlights;
//    public ArrayList flightList;

    public List findBestTrip(Date d, String dep, String dest, int nrPassenger){

        Airline air = new Airline();

        List<Flight> validFlights = air.getFlights(d, dep, dest, nrPassenger);
        //Change to right form
        
        if(!validFlights.isEmpty()){
            return validFlights;
        }
        else{
            //check with conection
            return validFlights;
        }
    }

//    public ArrayList findFlights(Date d, String dep, String dest, int pNumber){
//        flightList = new ArrayList();
//        return flightList;
//    }
//
//    public void getFlights(){
//    }
}
